<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<mesoBoard.Web.Models.ViewForum>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="bread_crumb left">
        <%= Html.ActionLink("Board Index", "Index", "Board")%>
        &raquo;
        <%= Html.ActionLink(Model.Forum.Name, "ViewForum", "Board", new { ForumID = Model.Forum.ForumID }, new { style = "font-weight:bold" })%>
    </div> 

    <div class="left">
        <%= Html.ActionLink("Create Thread", "CreateThread", "Post", new { ForumID = Model.Forum.ForumID }, new { @class = "img_link create-thread-link" })%>
    </div>

    <div class="right">
        <% if(Model.Paging.TotalPages != 1) Html.RenderPartial("Paging", Model.Paging); %>
    </div>

    <%= Html.Spacer(3) %>

    <table class="view_forum" cellpadding="3">
        <tr>
        <th class="image"></th>
        <th class="thread">Title</th>
        <th class="last_post">Last Post</th>
        <th class="stats">Posts</th>
        <th class="stats">Views</th>
        </tr>
        
        
        <% if(Model.GlobalAnnouncements.Count > 0 ) {  %>
            <tr>
                <th colspan="5">Global Announcements</th>
            </tr>
            <%  int q = 0;
                foreach(var t in Model.GlobalAnnouncements){
                    t.IsOdd = q++ % 2 == 0;
                   Html.RenderPartial("ThreadRow",t);
               } %>                
        <%} %>
       
        <tr><th colspan="5" style="text-align: left">Threads</th></tr>
        <% if(Model.ThreadRows.Count == 0){%>
        <tr><td colspan="5" style="text-align: center">No Threads</td></tr>
        <%}%>
        <%  int j = 0;
            foreach(mesoBoard.Web.Models.ThreadRow t in Model.ThreadRows){
                t.IsOdd = j++ % 2 == 0;
                Html.RenderPartial("ThreadRow", t);
           } %>
    </table>

    <%= Html.Spacer(3) %>

    <div class="left">
        <%= Html.ActionLink("Create Thread", "CreateThread", "Post", new { ForumID = Model.Forum.ForumID }, new { @class = "img_link create-thread-link" })%>
        <div class="bread_crumb">
            <%= Html.ActionLink("Board Index", "Index", "Board")%>
            &raquo;
            <%= Html.ActionLink(Model.Forum.Name, "ViewForum", "Board", new { ForumID = Model.Forum.ForumID }, new { style = "font-weight:bold" })%>
        </div> 
        <br />
        <table>
            <tr><td><%= Html.ThemeImage("new_thread.png") %></td><td>Thread</td></tr>
            <tr><td><%= Html.ThemeImage("new_sticky.png") %></td><td>Sticky</td></tr>
            <tr><td><%= Html.ThemeImage("new_announcement.png") %></td><td>Announcement</td></tr>
        </table>
    </div>

    <div class="right" style="text-align: right">
        <% if(Model.Paging.TotalPages != 1) Html.RenderPartial("Paging", Model.Paging); %>
        <br />
        <% Html.RenderPartial("ForumPermissions", Model.UserPermissions); %>
    </div>
</asp:Content>